package demo23.v1;

import java.util.TimerTask;
import java.util.concurrent.TimeUnit;

public class MyTimer {
    public void schedule(TimerTask task, long delay){
        new Thread(() -> {
            try {
                TimeUnit.SECONDS.sleep(delay);
                task.run();
            } catch (InterruptedException exc){

            }
        }).start();
    }
}
